//
//  BQLeaveUserCell.m
//  BeeQuick
//
//  Created by 万伶童 on 16/11/21.
//  Copyright © 2016年 six_group. All rights reserved.
//

#import "BQLeaveUserCell.h"

@implementation BQLeaveUserCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier])
    {
        [self setupUI];
    }
    return self;
}

- (void)setupUI
{
    
    UIButton * leaveUser = [[UIButton alloc]init];
    [leaveUser setTitle:@"退出当前账号" forState:UIControlStateNormal];
    [leaveUser setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    [leaveUser addTarget:self action:@selector(cancel) forControlEvents:UIControlEventTouchUpInside];
    [self.contentView addSubview:leaveUser];
    
    [leaveUser mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.center.equalTo(self.contentView);
        make.size.mas_equalTo(CGSizeMake(200, 30));
        
    }];
    
    
    
    
}
#pragma mark - 注销 按钮点击事件
- (void)cancel
{
    
// 
//    UIAlertView * alertView = [[UIAlertView alloc]initWithTitle:nil message:@"你确定要退出当前的账号吗" delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"确定", nil];
//    
//    [alertView show];
//    
//    
    if([self.delegate respondsToSelector:@selector(pushToQuitView)])
        
    {
        [self.delegate pushToQuitView];
    }
    
    
}


- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
